﻿@{
    Layout = null;

    string gjz = ViewData["gjz"] == null ? "" : ViewData["gjz"].ToString();
    string queryparamStr = "&gjz=" + gjz;
}
@model List<YQGL.Model.DJ_QYXX>
@helper GerneratePager(string page, string allpage, string srcurl, string queryparam)
{
    <div class="pagin" style="float:right;">


        <ul class="pagination">

            @if (int.Parse(@allpage.ToString()) > 9)
            {
                if (int.Parse(@page.ToString()) == 1)
                {
                    <li class="prev disabled"><a href="#" title="First"><i class="fa fa-angle-left"></i></a></li>
                }
                else
                {
                    <li class="prev ">
                        <a href="@srcurl@(int.Parse(@page.ToString()) - 1)@queryparam">
                            <i class="fa fa-angle-left"></i>
                        </a>
                    </li>
                }
                if (int.Parse(@page.ToString()) < 6)
                {
                    for (int i = 1; i <= 6; i++)
                    {
                        if (i == int.Parse(@page.ToString()))
                        {
                            <li class="paginItem active"><a href="@srcurl@i@queryparam">@i</a></li>
                        }
                        else
                        {
                            <li class="paginItem"><a href="@srcurl@i@queryparam">@i</a></li>
                        }
                    }
                    <li class="paginItem more"><a href="javascript:;">...</a></li>
                    for (int i = int.Parse(@allpage.ToString()) - 2; i <= int.Parse(@allpage.ToString()); i++)
                    {
                        <li class="paginItem"><a href="@srcurl@i@queryparam">@i</a></li>
                    }
                }
                else if (int.Parse(@page.ToString()) > int.Parse(@allpage.ToString()) - 5)
                {
                    for (int i = 1; i <= 3; i++)
                    {
                        <li class="paginItem"><a href="@srcurl@i@queryparam">@i</a></li>
                    }
                    <li class="paginItem more"><a href="javascript:;">...</a></li>

                    for (int i = int.Parse(@allpage.ToString()) - 5; i <= int.Parse(@allpage.ToString()); i++)
                    {
                        if (i == int.Parse(@page.ToString()))
                        {
                            <li class="paginItem active"><a href="@srcurl@i@queryparam">@i</a></li>
                        }
                        else
                        {
                            <li class="paginItem"><a href="@srcurl@i@queryparam">@i</a></li>
                        }
                    }
                }
                else
                {
                    for (int i = 1; i <= 3; i++)
                    {
                        <li class="paginItem"><a href="@srcurl@i@queryparam">@i</a></li>
                    }
                    <li class="paginItem more"><a href="javascript:;">...</a></li>
                    <li class="paginItem"><a href="@srcurl@(int.Parse(@page.ToString()) - 1)@queryparam">@(int.Parse(@page.ToString()) - 1)</a></li>
                    <li class="paginItem active"><a href="@srcurl@(int.Parse(@page.ToString()))@queryparam">@int.Parse(@page.ToString())</a></li>
                    <li class="paginItem"><a href="@srcurl@(int.Parse(@page.ToString()) + 1)@queryparam">@(int.Parse(@page.ToString()) + 1)</a></li>
                    <li class="paginItem more"><a href="javascript:;">...</a></li>
                    for (int i = int.Parse(@allpage.ToString()) - 2; i <= int.Parse(@allpage.ToString()); i++)
                    {
                        <li class="paginItem"><a href="@srcurl@i@queryparam">@i</a></li>
                    }
                }

                if (int.Parse(@page.ToString()) == int.Parse(@allpage.ToString()))
                {
                    <li class="next"><a><i class="fa fa-angle-right"></i></a></li>
                }
                else
                {
                    <li class="next">
                        <a href="@srcurl@(int.Parse(@page.ToString()) + 1)@queryparam">
                            <i class="fa fa-angle-right"></i>
                        </a>
                    </li>
                }
            }
            else
            {

                if (int.Parse(@page.ToString()) == 1)
                {
                    <li class="prev disabled"><a href="#" title="First"><i class="fa fa-angle-left"></i></a></li>
                }
                else
                {
                    <li class="prev">
                        <a href="@srcurl@(int.Parse(@page.ToString()) - 1)@queryparam">
                            <i class="fa fa-angle-left"></i>
                        </a>
                    </li>
                }

                for (int i = 1; i <= int.Parse(@allpage.ToString()); i++)
                {
                    if (i == int.Parse(@page.ToString()))
                    {
                        <li class="paginItem active"><a href="@srcurl@i@queryparam">@i</a></li>
                    }
                    else
                    {
                        <li class="paginItem"><a href="@srcurl@i@queryparam">@i</a></li>
                    }
                }
                if (int.Parse(@page.ToString()) == int.Parse(@allpage.ToString()))
                {
                    <li class="next"><a><i class="fa fa-angle-right"></i></a></li>
                }
                else
                {
                    <li class="next">
                        <a href="@srcurl@(int.Parse(@page.ToString()) + 1)@queryparam">
                            <i class="fa fa-angle-right"></i>
                        </a>
                    </li>
                }

            }
        </ul>

    </div>




}
<!DOCTYPE html>

<!--[if IE 8]> <html lang="en" class="ie8 no-js"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9 no-js"> <![endif]-->
<!--[if !IE]><!-->
<html lang="en">
<!--<![endif]-->
<!-- BEGIN HEAD -->
<head>
    <meta charset="utf-8" />
    <title>菜单</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta content="width=device-width, initial-scale=1.0" name="viewport" />
    <meta http-equiv="Content-type" content="text/html; charset=utf-8">

    <!-- BEGIN GLOBAL MANDATORY STYLES -->

    <link href="/assets/global/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
    <link href="/assets/global/plugins/simple-line-icons/simple-line-icons.min.css" rel="stylesheet" type="text/css" />
    <link href="/assets/global/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
    <link href="/assets/global/plugins/uniform/css/uniform.default.css" rel="stylesheet" type="text/css" />

    <!-- END GLOBAL MANDATORY STYLES -->
    <!-- BEGIN THEME STYLES -->
    <link href="/assets/global/css/components.css" id="style_components" rel="stylesheet" type="text/css" />
    <link href="/assets/admin/layout/css/layout.css" rel="stylesheet" type="text/css" />
    <!-- END THEME STYLES -->
    <link rel="shortcut icon" href="favicon.ico" />
    <!--[if lt IE 9]>
    <script src="/assets/global/plugins/respond.min.js"></script>
    <script src="/assets/global/plugins/excanvas.min.js"></script>
    <![endif]-->
    <script src="/assets/global/plugins/jquery.min.js" type="text/javascript"></script>
    <script src="/assets/global/plugins/jquery-migrate.min.js" type="text/javascript"></script>
    <!-- IMPORTANT! Load jquery-ui.min.js before bootstrap.min.js to fix bootstrap tooltip conflict with jquery ui tooltip -->
    <script src="/assets/global/plugins/jquery-ui/jquery-ui.min.js" type="text/javascript"></script>
    <script src="/assets/global/plugins/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
    <script type="text/javascript">
    $(document).ready(function () {


    })

    function search()
    {

        window.location.href = '@ViewData["srcurl"].ToString()' + "1&gjz=" + $("#gjz").val();

    }

    function reset()
    {

        window.location.href = '@ViewData["srcurl"].ToString()' + "1";


    }
    
    </script>

</head>

<body class=" ">


    <div class="page-container" style="max-width:600px;margin-left:auto;margin-right:auto">

        <div class="page-content-wrapper">
            <div class="page-content" style="margin-left:5px;">
                <div class="page-bar">
                    <ul class="page-breadcrumb">
                        <li>
                            <i class="fa fa-home"></i>
                            <a href="@Url.Action("Index", "AdminMenu")">首页</a>
                            <i class="fa fa-angle-right"></i>
                        </li>
                        <li>
                            <a href="@Url.Action("Index", "EnterpriseQuery")">企业查询</a>
                           
                        </li>
                       
                    </ul>

                </div>

                <div class="row">
                    <div class="col-md-12">
                        <!-- BEGIN SAMPLE TABLE PORTLET-->
                        <div class="portlet box green">
                            <div class="portlet-title">
                                <div class="caption">
                                    <i class="fa fa-search"></i>企业查询
                                </div>
                                <div class="tools">

                                </div>
                            </div>
                            <div class="portlet-body">

                                <div class="row">

                                    <div class="col-md-12 >
                                        <div class="form-group">
                                            <label class="control-label pull-left" style="padding-top:6px;">关键字:</label><input type="search" class="form-control input-small input-inline  pull-left" value="@ViewData["gjz"]" placeholder="请输入" aria-controls="sample_2" id="gjz"><button type="button" class="btn btn-success  pull-left" onclick="search()">查询</button><button type="button" class="btn purple" onclick="reset()">重置</button>
                                        </div>
                                    </div>
                                </div>
                                <div class="table-scrollable">
                                    <table class="table  table-bordered table-hover" style="table-layout:fixed;">
                                        <thead>
                                            <tr>
                                               
                                                <th style="width:400px;text-align:center;">
                                                    企业名称
                                                </th>
                                                <th align="center" style="width:120px;text-align:center;">
                                                    法人
                                                </th>

                                            </tr>
                                        </thead>
                                        <tbody>

                                            @if (Model != null)
                                            {

                                                foreach (var item in Model)
                                                {


                                                    <tr>
                                                        <td align="center" style="overflow:  hidden; white-space: nowrap; -o-text-overflow: ellipsis; text-overflow:  ellipsis;">
                                                            <span class="label label-sm label-success" style="padding-top:4px;padding-bottom:4px;">
                                                                <a href="@Url.Action("Index", "EnterpriseDetail", new  { ZCH=item.ZCH })" style="color:white;"> @item.Nsrmc</a>
                                                            </span>
                                                        </td>
                                                       
                                                        <td align="center">
                                                            @item.FDDBRMC
                                                        </td>

                                                    </tr>
                                                }
                                            }
                                        </tbody>
                                    </table>
                                </div>


                                <div class="row">
                                    <div class="col-md-12 " style="text-align:right;">
                                        @if (Model != null)
                                        {
                                            @GerneratePager(ViewData["page"].ToString(), ViewData["allpage"].ToString(), ViewData["srcurl"].ToString(), queryparamStr)
                                        }
                                    </div>
                                </div>
                            </div>
                        </div>
                        <!-- END SAMPLE TABLE PORTLET-->
                    </div>

                </div>
            </div>
        </div>

    </div>


</body>
<!-- END BODY -->
</html>